import QtQuick 6.2
import QtQuick.Controls 6.2
import Qt.labs.qmlmodels 6.2

Rectangle {
    id: homePage
    anchors.fill: parent

    Rectangle {
        id: cardHeaderView
        anchors.left: parent.left
        anchors.top: parent.top
        anchors.right: parent.right
        height: 250
        color: "#424852"

        Input{
            anchors.left: parent.left
            anchors.leftMargin: 10
            anchors.top: parent.top
            anchors.topMargin: 10
            id: noInput
            cInputLabelText: "桌号"
            cPlaceholderTextValue: "请输入桌号"
            cInputlabelWidth: 65
        }

        Row {
            spacing: 10 // 元素之间的距离
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 10
            anchors.right: parent.right
            anchors.rightMargin: 10

            CButton {
                id: searchBtn
                textValue: "搜索"
            }
            CButton {
                id: addBtn
                textValue: "新增"
            }

        }

    }



    CTableView{
        id: tableView
        anchors.left: parent.left
        anchors.top: cardHeaderView.bottom
        anchors.bottom: parent.bottom
        anchors.right: parent.right
        columnsWidth: 110
        headerList: ["日期","地点","地址","经度","纬度","备注"]//不自己设置时，表头使用model数据列名
        model:  ListModel{
            id:listModel
            ListElement{
                PARTNO:"20201130"
                PLACE:"小山村"
                ADDRESS:"265454"
                JD:"105.0265"
                WD:"26.3265"
                BACKUP:" 2020-11-30 09:59:19"
            }
            ListElement{
                PARTNO:"20201130"
                PLACE:"大山村"
                ADDRESS:"265454"
                JD:"105.0265"
                WD:"26.3265"
                BACKUP:" 2020-11-30 09:59:19"
            }
        }
        Component.onCompleted: {
            var c2 = dataListView.getColumnWidth(2)
            var c5 = dataListView.getColumnWidth(5)
            dataListView.setColumnWidth(2,c2-50)
            dataListView.setColumnWidth(5,c5+100)
        }


    }





}
